import 'package:tender_flutter/page/person/model/poster_entity.dart';
import 'package:flutter/cupertino.dart';

posterEntityFromJson(PosterEntity data, Map<String, dynamic> json) {
	if (json['code'] != null) {
		data.code = json['code'];
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['pic'] != null) {
		data.pic = json['pic'].toString();
	}
	if (json['priority'] != null) {
		data.priority = json['priority'] is String
				? int.tryParse(json['priority'])
				: json['priority'].toInt();
	}
	return data;
}

Map<String, dynamic> posterEntityToJson(PosterEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['code'] = entity.code;
	data['id'] = entity.id;
	data['pic'] = entity.pic;
	data['priority'] = entity.priority;
	return data;
}